package etnorservice.etnor_service.mapper;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2024/11/30/11:08
 **/

import etnorservice.etnor_service.domain.dto.CommentDTO;
import etnorservice.etnor_service.domain.po.Comment;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

@Mapper
public interface CommentMapper {
    // 插入评论
    int insert(CommentDTO comment);

    // 根据API ID获取评论列表
    List<Comment> findByApiId(Long apiId);

    // 更新评论
    int update(Comment comment);

    // 删除评论
    int deleteById(Long id);

    // 根据ID查询评论
    Comment findById(Long id);

    // 更新评论的点赞数
    int updateLikesCount(Long id, int likesCount);

    // 更新评论的回复数
    int updateRepliesCount(Long id, int repliesCount);
}